package cn.cdeden.knowledge.domain.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @ProjectName : ecm_svn02
 * @Package : com.cdyd.ecm.notice.message.util.enums
 * @ClassName : MessageEnums
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2023/11/28 17:30
 * @Version : 1.0
 */
@Getter
//@AllArgsConstructor
public enum MessageTypeEnums {

    ADD("add", "新增"),
    UPDATE("update", "修改"),
    DELETE("delete", "删除");
    MessageTypeEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private final String code;
    private final String name;

    public static MessageTypeEnums find(String type) {
        for (MessageTypeEnums value : MessageTypeEnums.values()) {
            if (StringUtils.equalsIgnoreCase(type, value.getCode())) {
                return value;
            }
        }
        return null;
    }


}
